home *** CD-ROM | disk | FTP | other *** search
- Path: mother.usf.edu!news
- From: Chris Frenck <cfrenck@soleil.acomp.usf.edu>
- Newsgroups: comp.lang.c
- Subject: simple struct error check question
- Date: Thu, 21 Mar 1996 10:50:03 -0500
- Organization: University of South Florida
- Message-ID: <31517AAB.77C0@soleil.acomp.usf.edu>
- NNTP-Posting-Host: ppp141.cfr.usf.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win95; I)
-
- This is a simple structure program I am writing and am wondering how to
- error check the input size of the members. Here is the pertinent code
- information. Any help would be great!
-
- struct Dbase
- { char fname[NMAX];
- char lname[NMAX];
- char address[AMAX];
- char phone[PMAX];
- };
- main()
- .
- .
-
- void add(struct Dbase *dbase) **add subroutine**
- . misc lines of code
- .
- printf("\nFull Name in (first last) format=> ");
- scanf(" %s %s", dbase->fname, dbase->lname);
-
- How can I ensure that fname and lname do not exceed their max size?
-
- TIA
- Chris Frenck
- cfrenck@soleil.acomp.usf.edu
-